package com.aruba.databinding2;

import android.util.Log;

import androidx.databinding.ObservableField;

/**
 * Created by aruba on 2021/9/11.
 */
public class UserViewModel2 {
    private static final String TAG = UserViewModel2.class.getSimpleName();
    private ObservableField<User> userObservableField;

    public UserViewModel2() {
        User user = new User("赵四");
        userObservableField = new ObservableField<>(user);
    }

    public String getUserName() {
        return userObservableField.get().userName;
    }

    public void setUserName(String userName) {
        Log.i(TAG,userName);
        userObservableField.get().userName = userName;
    }
}
